import java.util.ArrayList;
import java.util.List;

public class AnimalRuleLibrary {
    private List<AnimalRule> rules = new ArrayList<>();

    public void addRule(AnimalRule rule) {
        rules.add(rule);
    }

    public String deduceAnimalType(Animal animal) {
        for (AnimalRule rule : rules) {
            if (rule.checkCondition(animal)) {
                return rule.getConclusion();
            }
        }
        return "未知动物";
    }
}
